<%@page import="com.dxl.dao.common.context.SessionContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" session="false"%>
<%@ include file="/WEB-INF/view/common/loginCheck.jspf" %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<base href="${ROOT}" />
	<title>榄菊开单系统</title>
	<link rel="stylesheet" type="text/css" href="${ROOT}/static/js/easyui/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="${ROOT}/static/js/easyui/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="${ROOT}/static/js/uploadify/uploadify.css" />
	<style type="text/css">
		body {
			padding: 0px;
			margin: 0px;
		}
		.menuItems {
			list-style: none;
			margin: 0px;
			padding: 0px;
		}
		.menuItems li {
			margin-top: 5px;
			width: 100%;
			height: 20px;
			line-height: 20px;
		}
		.menuItems li:hover {
			cursor: pointer;
			font-weight: bold;
		}
		.menuItemSelected {
			font-weight: bold;
		}
	</style>
</head>
<body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north'" style="height:40px;background-color: #E0ECFF;">
			<div style="float:right;margin-right: 20px;margin-top:5px;vertical-align: middle;">
				<a class="easyui-linkbutton" data-options="plain:true,iconCls:''">欢迎使用该系统，<b><%=(Utils.isBlank(SessionContext.getAccountName()) ? SessionContext.getAccount() : SessionContext.getAccountName())%></b></a>
				<a href="${ROOT}/logout" title="退出系统" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-no'">退出</a>
			</div>
		</div>
		
		<div data-options="region:'west',split:true,iconCls:''" title="系统菜单" style="width:200px;">
			<div id="indexAccordion" class="easyui-accordion" data-options="fit:true,border:false">
				<t:permission codes="ACCOUNT-VIEW|ROLE-VIEW|FUNCTION-VIEW">
				<div title="账号管理" data-options="iconCls:''" style="padding:10px;">
					<ul class="menuItems">
						<t:permission codes="ACCOUNT-VIEW">
						<li url="${ROOT}/account">账号信息管理</li>
						</t:permission>
						<t:permission codes="ROLE-VIEW">
						<li url="${ROOT}/account/role">角色信息管理</li>
						</t:permission>
						<t:permission codes="FUNCTION-VIEW">
						<li url="${ROOT}/account/function">功能信息管理</li>
						</t:permission>
					</ul>
				</div>
				</t:permission>
				
				<t:permission codes="SYSPROP-VIEW|AREA-VIEW|USER-VIEW|SHOP-VIEW|PRODUCT-VIEW">
				<div title="基础管理" data-options="iconCls:''" style="padding:10px;">
					<ul class="menuItems">
						<t:permission codes="SYSPROP-VIEW">
						<li url="${ROOT}/sysprop">系统配置管理</li>
						</t:permission>
						<t:permission codes="AREA-VIEW">
						<li url="${ROOT}/area">区域信息管理</li>
						</t:permission>
						<t:permission codes="USER-VIEW">
						<li url="${ROOT}/user">业 务 员 管 理</li>
						</t:permission>
						<t:permission codes="SHOP-VIEW">
						<li url="${ROOT}/shop">门店信息管理</li>
						</t:permission>
						<t:permission codes="PRODUCTCATE-VIEW">
						<li url="${ROOT}/productCate">品类信息管理</li>
						</t:permission>
						<t:permission codes="PRODUCT-VIEW">
						<li url="${ROOT}/product">产品信息管理</li>
						</t:permission>
					</ul>
				</div>
				</t:permission>
				
				<t:permission codes="SHOP-VIEW">
				<div title="门店管理" data-options="iconCls:'',selected:true" style="padding:10px;">
					<ul class="menuItems">
						<t:permission codes="SHOP-AUDIT">
						<li url="${ROOT}/shop/audit">门店审核管理</li>
						</t:permission>
						<t:permission codes="REPORT-SHOP-VIEW">
						<li url="${ROOT}/report/shop">门店信息管理</li>
						</t:permission>
						<t:permission codes="REPORT-SHOPVISIT-VIEW">
						<li url="${ROOT}/report/visit">门店拜访管理</li>
						</t:permission>
					</ul>
				</div>
				</t:permission>
				
				<t:permission codes="STOCK-VIEW">
				<div title="库存管理" data-options="iconCls:''" style="padding:10px;">
					<ul class="menuItems">
						<t:permission codes="STOCK-VIEW">
						<li url="${ROOT}/stock">区域库存管理</li>
						</t:permission>
					</ul>
				</div>
				</t:permission>
			</div>
		</div>
		
		<div data-options="region:'center',title:'操作区',iconCls:'',fit:false">
			<div id="mainTabDiv" class="easyui-tabs" data-options="fit:true,border:false,plain:true">
				<div title="首页" data-options="href:'${ROOT}/main.jsp'" style="padding:10px"></div>
			</div>
		</div>
	</div>
	
	<script type="text/javascript" src="${ROOT}/static/js/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="${ROOT}/static/js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ROOT}/static/js/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="${ROOT}/static/js/uploadify/jquery.uploadify.min.js"></script>
	<script type="text/javascript" src="${ROOT}/static/js/common/common.js"></script>
	<script type="text/javascript">
		$(document).ready(function (){
			setInterval('checkLogin()',10000);
		});
		
		function checkLogin() {
			APP.post({
				url: '${ROOT}/isLogin?_rt=' + new Date().getTime(),
				data: {
				},
				success: function (data) {
					var json = eval('(' + data + ')');
					if (json.success && !json.data) {
						window.location.href='${ROOT}/login.jsp';
					}
				}
			});
		}
	</script>
</body>
</html>
